﻿@model IEnumerable<FlyingClub.Models.Flight>

@{
    ViewBag.Title = "Validate";
}

<h2>Validate</h2>

<table>
    <tr>
        <th>
            Date de départ
        </th>
        <th>
            Aéroport de départ
        </th>
        <th>
            Date d'arrivée
        </th>
        <th>
            Aéroport d'arrivée
        </th>
        <th>
            Pilote
        </th>
        <th>
            Etudiant
        </th>
        <th>
            Avion
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.DepartureDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DepartureAirfield)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ArrivalDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ArrivalAirfield)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Pilot.Firstname) @Html.DisplayFor(modelItem => item.Pilot.Lastname)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Pilot.Firstname) @Html.DisplayFor(modelItem => item.Student.Lastname)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Plane.Name)
        </td>
        <td>
            @Html.ActionLink("Valider", "ValidateFlight", new { id=item.ID })
        </td>
    </tr>
}